import requests
import re
from log.header import get_headers
import time
import random

time = int(time.time()*1000)
print(time)


# 局部刷新
# url = f"https://api.bilibili.com/x/web-interface/wbi/index/top/feed/rcmd?&ps=10&wts={time}&fresh_idx={random.randint(1,10)}&brush={random.randint(1,10)}"
# res = requests.get(url,headers=get_headers())
# items = res.json()['data']['item']
#     # print(items)
# for item in items:
#     print(item['uri'],item['title'])


# 下拉刷新 # fresh_idx={random.randint(1,10)}&brush={random.randint(1,10)}这里变动的数字要遵从一定的规则这里我没有找我随机了
# url = f'https://api.bilibili.com/x/web-interface/wbi/index/top/feed/rcmd?&ps=12&fresh_idx={random.randint(1,10)}&brush={random.randint(1,10)}'
# response = requests.get(url,headers=get_headers())
# items = response.json()['data']['item']
#     # print(items)
# for item in items:
#     print(item['uri'],item['title'])